package com.tuni.birthdaymoney.service;

import com.mysema.query.types.expr.BooleanExpression;
import com.tuni.birthdaymoney.persistence.entity.Operation;
import com.tuni.birthdaymoney.persistence.entity.Person;
import com.tuni.birthdaymoney.web.model.Donator;
import com.tuni.birthdaymoney.web.model.OperationHistoryPage;

public interface OperationService {

    void saveDonation(Operation operation);

    void saveMoneyBack(Operation operation);

    Iterable<Donator> getDonators(Person receiptor);
    
    Iterable<Donator> getDonators(Person receiptor, int year);

    double getTotalAmount(Person receiptor, int year);

    Donator getDonatorById(Person receiptor, int id);

    public Operation findByID(Integer id);

    public Iterable<Operation> findAll(BooleanExpression expression);

    public Iterable<Operation> findAll();

    BooleanExpression prepareBooleanExpresion(OperationHistoryPage operationHistoryPageModel);

    Iterable<Operation> findAllOrderedByDate();

    Iterable<Operation> findAllOrderedByDate(BooleanExpression expression);

    public Iterable<Integer> getAllYears();
}
